﻿using System;
using System.Runtime.Serialization;

namespace Collab.Services.Remote.Entities
{
    [DataContract(Namespace = "http://collab.codeplex.com/2010/10/Schemas")]
    public class UserStatus : IExtensibleDataObject
    {

        [DataMember(Order = 1, IsRequired = true)]
        public Guid Sender { get; private set; }
        [DataMember(Order = 2, IsRequired = false)]
        public UserSelection Selection { get; set; }
        [DataMember(Order = 3, IsRequired = true)]
        public string ActiveFile
        {
            get
            {
                return this.activeFile;
            }
            set
            {
                if (this.activeFile == value)
                    return;
                this.activeFile = value ?? "No file selected";
            }
        }
        private string activeFile;

        public UserStatus(Guid sender, string activeFile)
        {
            this.Sender = sender;
            this.ActiveFile = activeFile;
        }

        #region IExtensibleDataObject Members

        public ExtensionDataObject ExtensionData { get; set; }

        #endregion
    }
}
